import java.util.Scanner;

public class Tourist {
    String name;
    int age;
    int price;

    public void show() {
        if (age <= 6 && age > 0) {
            System.out.println("姓名：" + name + "，年龄：" + age+"，门票免费");
        } else if (age >= 6 && age <= 16) {
            System.out.println("姓名：" + name + "，年龄：" + age+"，门票价格20元");
        } else if (age >= 16 && age <= 60) {
            System.out.println("姓名：" + name + "，年龄：" + age+"，门票价格30元");
        } else {
            System.out.println("姓名：" + name + "，年龄：" + age+"，门票免费");
        }
    }

    public static void main(String[] args) {
        Tourist t=new Tourist();
        String reply = null;
        do {
            Scanner in = new Scanner(System.in);
            System.out.println("请输入姓名：");
            String name = in.next();
            t.name = name;
            System.out.println("请输入年龄：");
            int age = in.nextInt();
            t.age = age;
            t.show();
            System.out.println("是否继续购票(y/n)：");
            reply=in.next();

        }while ("y".equals(reply));
        System.out.println("感谢下次光临");
    }
}
